<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>忘记密码时的修改密码页面</title>
</head>
<body>
    <form>
        <div>请输入新密码： <input type="password" id="password"></div>
        <div><input type="button" value="提交" id="newPasswordBtn">
        </div>
    </form>
</body>
</html>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
    $(document).ready(function (){
        $("#newPasswordBtn").click(function (){
            var data = {'password':$("#password").val()};
            $.ajax({
                method:"post",
                url:"student?action=forgetUpdatePassword",
                data:data,
                type:"json",
                success:function (result){
                    if (result.code == 10001){
                        alert(result.msg);
                        location.href = "login.html";
                    }else {
                        alert(result.msg);
                    }
                }
            });
        })
    })


</script>